try:
    num = int(input("请输入数字："))

    result = 8 / num

    print(result)
except (ValueError, ZeroDivisionError):
    print("发生了异常")
